﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace OneAPI.Models
{
    public class OneDataContext : DbContext
    {
        public OneDataContext (DbContextOptions<OneDataContext> options)
            : base(options)
        {
        }
         
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Serial>()
                .Property<string>("SerialCollection")
                .HasField("_serials");
        }

        public DbSet<Content> Contents { get; set; }

        //public DbSet<Article> Articles { get; set; }

        public DbSet<Music> Musics { get; set; }

        public DbSet<Movie> Movies { get; set; }

        public DbSet<Author> Authors { get; set; }

        public DbSet<Serial> Serials { get; set; }

        public DbSet<Answer> Answers { get; set; }
    }
}
